<?php

namespace Pyaf\GymBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class ClaseType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('codigoClase', 'text', array('required'=>'false'))
            ->add('profesor', 'entity', array(
                        'class'         => 'Pyaf\\GymBundle\\Entity\\Profesor',
                        'query_builder' => function ($repositorio) {
                            return $repositorio->createQueryBuilder('p');
                        },
                ))
            ->add('dia','choice', array(
                    'choices' => array('Lunes' => 'Lunes', 'Martes' => 'Martes',
                        'Miércoles' => 'Miércoles','Juves' => 'Jueves', 'Viernes' 
                        => 'Viernes', 'Sábado' => 'Sábado', 'Domingo' => 'Domingo')
                    )
                )
            ->add('horario')
            ->add('nroCama', 'integer')
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Pyaf\GymBundle\Entity\Clase'
        ));
    }

    public function getName()
    {
        return 'pyaf_gymbundle_clasetype';
    }
}
